package cn.kent.receiver;

import cn.kent.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息消费者
 */
@Component
public class MsgReceiver {
    /**
     * 监听消息队列
     * @param msg
     */
    @RabbitListener(queues = RabbitMQConfig.HELLO_WORLD_QUEUE_NAME)
    public void receive(String msg) {
        System.out.println("msg = " + msg);
    }
}